package logic.pathelements;

import java.util.Collection;

import logic.connectors.Connector;

/**
 * 
 * @author Alex.Shilov92
 * @version 1.1
 *
 */
public class Cable extends PassiveElement{
	

//	/**
//	 * enum for Type Cable.
//	 * 0-shielded_twisted_pair;
//	 * 1-unshielded_twisted_pair;
//	 * 2-coaxial_cable
//	 * 3-fiber_optic;
//	 */
//	static enum TypeCable{
//		shielded_twisted_pair,
//		unshielded_twisted_pair,
//		coaxial_cable,
//		fiber_optic		
//	}
    
        public Cable(Integer id, int  Cost, int TimeDelay ) {
            super(id, 2);
            this.Id = id;
            this.cost = Cost;
            this.timeDelay = TimeDelay;
            this.infoCable = "Cost = " + Cost + ",TimeDelay =  " + timeDelay + ", Id =  "+Id;
	}
	
	/**	
	 * Constructor. Execute parent constructor of {@link PassiveElement}
	 * @author alex.shilov92
	 * @param Cost 				Cost cable
	 * @param TimeDelay 		Time delay for transmission data
	 * @param id				element ID
	 * @param connectorsCount	quantity of the connectors
	 */
	public Cable(Integer id, int connectorsCount, int  Cost, int TimeDelay ) {
		super(id, connectorsCount);
		this.Id = id;
		this.cost = Cost;
		this.timeDelay = TimeDelay;
		this.infoCable = "Cost = " + Cost + ",TimeDelay =  " + timeDelay + ", Id =  "+Id;
		
	}
	
	/**
	 * this function return collection e;ement from perent class
	 * @return Collection element from parent class
	 */
	public Collection<Connector> getConnector()
	{
		return connectors;
	}
	
	private int cost;
	private int timeDelay;	
	private String infoCable;
	//private int type;
	private Integer Id;
	
	@Override
	/**
	 * values nearly real cost
	 * @return Integer value, determined value nearly real cost
	 */
	public double getCosts() {
		return this.cost;
	}
	
	
	@Override
	/**
	 * @return Id cable
	 */
	public Integer getId()
	{
		return id;
	}
	
		
	@Override
	/**
	 * @return INfo about cable
	 */
	public String getInfo() {
		return this.infoCable;
	}
	
	@Override
	/**
	 * time delay in millisecond
	 * @return integer value, determine some time delay 
	 */
	public double getTimeDelay() {
		return this.timeDelay;
	}
	
	@Override
	public String toString() {
		return super.toString() + " " + infoCable ;
	}
}
